<template>
  <div class="shou">
    <div class="top">
        <h3>吃了吗</h3>
        <input type="text" placeholder="请输入商家、商品名称">
    </div>
    <div class="lubo">
        <img src="" alt="">
    </div>
    <div class="paixue">
        <div v-for="(item,index) in paixu" :key="index">{{item}}</div>
    </div>
    <div class="list" v-for="(item,index) in shop" :key="index">
        <div class="imgbox">
            <img :src="item.picUrl" alt="">
        </div>
        <div class="text">
            <h4>{{item.name}}</h4>
            <span>{{item.monthSalesTip}}</span><br>
            <span>评分：{{item.wmPoiScore}}</span>
            <span>距离：{{item.distance}}</span>
        </div>
    </div>
  </div>
</template>

<script>
import {shop_list,tuan_list,user_login} from '../utils/api'
export default {
    data() {
        return {
            paixu:['综合排序','距离最近',"销量最高",'筛选'],
            shop:[],
        }
    },
    mounted() {
    //在组件中 只需要调用封装好的函数 就可以发起ajax请求
    // 请求 店铺列表
    shop_list().then((res)=>{
    //   console.log(res.data);
      this.shop=res.data.list;
      console.log(this.shop);
    })
  },
}
</script>

<style lang="scss" scoped>
.shou{
    width: 100%;
    height: 100%;
}
.top{
    /* width: 100%; */
    padding: 10px;
    background-color: lightskyblue;
}
.top>input{
    width: 100%;
    text-align: center;
    border-radius: 10px;
    height: 20px;
}
.lubo{
    /* width: 100%; */
    padding: 10px;
}
.lubo>img{
    width: 100%;
    height: 80px;
    border-radius: 10px;
    border: none;
    background-color: aqua; 
}
.paixue{
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}
.list{
    display: flex;
    padding: 10px;
}
.list>.imgbox{
    width: 100px;
    background-color: aqua;
    margin-right:10px ;
}
.list>.imgbox>img{
    width: 100%;
}

</style>